'use strict';

stareal
    .controller("MyFollowListController", function ($scope, $stateParams, $api, $state,$lazyLoader,$rootScope,localStorageService, $alert) {
        $scope.comments = new $lazyLoader("app/view/followlist", {},true)
        //用户关注
        $scope.viewAttention=function(id) {
            $api.post("app/follow/create",{author_id:id},true)
                .then(function (ret) {
                    //console.log("333");
                    //  console.log(ret);
                    if(ret.follow==1){
                        //$scope.viewfavorText="已关注";
                        // $scope.comment.follow=1;
                        $alert.show("关注成功!");
                        location.reload();
                    }else{
                        //$scope.viewfavorText="+关注";
                        // $scope.comment.follow=0;
                        $alert.show("取消关注!");
                        location.reload();
                    }
                },function (err){
                    console.log(err);
                    $alert.show(err);
                })
        }
    });